ONNXModelHub

class ONNXModelHub(context: Context) : ModelHub

This class provides methods for loading ONNX model from android application resources.

Constructors

ONNXModelHub
Link copied to clipboard
fun ONNXModelHub(context: Context)

Functions

get
Link copied to clipboard
operator fun <T : InferenceModel, U : InferenceModel> get(modelType: ModelType<T, U>): U
loadModel
Link copied to clipboard
open override fun <T : InferenceModel, U : InferenceModel> loadModel(modelType: ModelType<T, U>, loadingMode: LoadingMode): T

It's equivalent to loadModel with ExecutionProvider.CPU execution provider.

fun loadModel(modelType: OnnxModelType<*>, vararg executionProviders: ExecutionProvider = arrayOf(ExecutionProvider.CPU())): OnnxInferenceModel

Loads ONNX model from android resources. By default, the model is initialized with ExecutionProvider.CPU execution provider.

loadPretrainedModel
Link copied to clipboard
fun <T : InferenceModel, U : InferenceModel> loadPretrainedModel(modelType: ModelType<T, U>, loadingMode: LoadingMode): U